﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Chat.aspx.cs" Inherits="CoolChat.Chat" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Cool Chat-Welcome!</title>
    <script type="text/javascript" src="jquery-1.10.2.js"></script>
    <script type="text/javascript" src="jquery.cookie.js"></script>
    <script type="text/javascript" src="jquery.stringifyjson.js"></script>
    <script type="text/javascript" src="jquery.download.js"></script>
    <script type="text/javascript" src="jquery-migrate-git.js"></script>
    <link href="css/chat.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/CoolChat.js"></script>
    <%--<script type="text/javascript" src="lang.js"></script>--%>
    <script type="text/javascript">
    </script>
    <link rel="stylesheet" href="editor/themes/default/default.css" />
    <script charset="utf-8" src="editor/kindeditor-all-min.js" type="text/javascript"></script>
    <script charset="utf-8" src="editor/lang/zh_CN.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
        var cool;
        CoolChat.ready({ chat: "#chat", isDebug: false, showMsgSuccess: true }, function (c) {
            cool = c;
            //cool.stopRev();
            cool.startFixedOnlineUserList("#userList");
            //cool.VirtualUser("查尔斯;Mir陈;请叫我土豪;Mircl;一路顺风;941发;陈龙;金大力;投机者;无利不早起;MagicQ;银先生;如影随形;hello;格雷特;发财专家;布鲁斯;陈大益;林进盛;Greatofme;非常时刻;孤注一掷;诺克萨斯;Angbaby;我是bug;陈自强;清晰的视野;强力的人;金主;投资者;吾爱贵金属;先知;金之投资;Mir金;Mir银;Lin陈;Superman;GOLDS;笨鸟先飞;夕阳的余晖;闪耀的金子;黎明前的黑夜;Mir金子;华丽的翻身;翻盘;华贵;comeonbaby;韩冷;Fate;年年有余");
            
            //$(".coolchat-chat-content-alert-text-holder").html($.stringifyJSON(cool.user));
            try {
            } catch (err) {
                alert(err.message + "\r\n" + err.description + "\r\nerror num: " + err.number);
            }
            $("#todaymsgs").click(function () {
                var msgswindow = new CoolChat.Dailog('<ul id="msgswinodwul" style="text-align: left;list-style:none;"></ul>', { W: 600, H: 400 });
                $.ajax({
                    url: c.todayMsgsUrl,
                    cache: false,
                    dataType: "JSON",
                    success: function (data, textStatus, jqXHR) {
                        for (var x in data) {
                            var item = c.htmlMsgItem(data[x]);
                            item.removeAttr("style");
                            item.css("border-bottom", "1px dashed gray");
                            $("#msgswinodwul").append(item);
                        }
                        msgswindow.show();
                    },
                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                        CoolChat.alert(CoolChat.dLan.WORK_FAILED + " " + textStatus + ":" + errorThrown, {
                            Type: CoolChat.AlertOption.Type.error,
                            Position: CoolChat.AlertOption.Position.top
                        });
                    }
                });
            });
            //$("#debug_msg_holder").html(cool.lan.WELCOME);
            var time = CoolChat.formatTimeString(new Date());
            //$("#debug_msg_holder").html($.stringifyJSON(cool.user));
            cool.PrependDebugInfo("To: " + $.stringifyJSON(cool.user));
        });
        function times() {
            $("#debug_msg_holder").html(CoolChat.formatTimeString(new Date()));
            //setTimeout("times()",1);
        }
        times();
    </script>
    <style type="text/css">
        #userList
        {
            position: absolute;
            top: 200px;
            right: 0px;
            /*border: 1px solid blue;*/
            max-height: 200px;
            overflow: hidden;
            overflow-y: auto;
            overflow-x: hidden;
            width: auto;
        }
        #maxlarge
        {
            height: 100%;
        }
    </style>
</head>
<body>
    
    <form id="form1" runat="server" style="width: 100%;height: 100%;" target=_self>
    <div id="maxlarge">        
        <div id="chat">
        </div>
        <div id="chat-editor"></div>
        <div id="userList">
            <div class="coolchat-chat-user-list">
            </div>
        </div>
        <a id="todaymsgs" class="coolchat-send-method" href="javascript:void(0);">今天的消息</a>
    </div>
    </form>
</body>
</html>
